// @ts-ignore

/* eslint-disable */
import { request } from "umi";
/** 获取当前的用户 GET /api/currentUser */

export async function getList(params, options) {
  return request("/baseApi/originalitem/datatablelistdata", {
    method: "GET",
    params: { ...params },
    ...(options || {}),
  });
}

// 详情
export async function getDetail(params, options) {
  return request("/baseApi/originalitem/getdatatablebyid", {
    method: "GET",
    params: { ...params },
    ...(options || {}),
  });
}

// 详情
export async function getSqlDetail(params, options) {
  return request("/baseApi/originalitem/getTableSqlbyid", {
    method: "GET",
    params: { ...params },
    ...(options || {}),
  });
}

// sql 查询
export async function upadataField(body, options) {
  return request("/baseApi/originalitem/executesql", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

// 分类列表
export async function getTree(params, options) {
  return request("/baseApi/originalcatalogue/getDataUnitList", {
    method: "GET",
    params: { ...params },
    ...(options || {}),
  });
}

// 库列表
export async function getSourcedataList(params, options) {
  return request("/baseApi/originaldata/getDataResourceList", {
    method: "GET",
    params: { ...params },
    ...(options || {}),
  });
}
